package mogiksaop.qliphoth.common.items;

import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import mogiksaop.qliphoth.common.entities.EntityQliphortScout;
import mogiksaop.qliphoth.common.lib.LibItemNames;

public class ItemQliphortScoutSoul extends ItemQliphortSoul
{
    public ItemQliphortScoutSoul()
    {
        super(LibItemNames.QLIPHORT_SCOUT_SOUL);
    }
    
    @Override
    public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
    {
    	if(!worldIn.isRemote)
    	{
    		if(player.isCreative())
    		{
    			EntityLiving entityLiving = new EntityQliphortScout(worldIn);
                entityLiving.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5);
                worldIn.spawnEntity(entityLiving);
    		}
    	}
        return EnumActionResult.PASS;
    }
}
